/*
 * @Author: csxjy
 * @LastEditors: csxjy
 * @Date: 2023-08-31 13:58:46
 * @LastEditTime: 2023-10-08 17:30:19
 * @FilePath: \dcp-user-center-admin-view\sh\cp.js
 * @Description:
 *
 * Copyright (c) 2023 by 天河数云/智能计算事业部, All Rights Reserved.
 */
const shell = require('shelljs')
const colors = require('colors-console')
const { name } = require('../package.json')

console.log(colors('green', `开始复制dist到${name}`));

const i = shell.mv(`./dist`, `./${name}/`)
if (i.code !== 0) {
  console.log(colors('red', '更改文件夹名失败', info.stderr))
}

shell.exec('sleep 1');

const info = shell.mkdir('-p', `./dist`)
if (info.code !== 0) {
  console.log(colors('red', '创建目录失败', info.stderr))
}

shell.exec('sleep 1');

const j = shell.mv(`./${name}`, './dist')
if (j.code !== 0) {
  console.log(colors('red', '移动文件夹失败', info.stderr))
}

console.log(colors('green', `复制dist到${name}结束`));
